<template>
	<view class="help">
		<view class="list">
			<view class="list-group">
				<view class="list-item" v-for="(help, index) in helps" :key="index">
					<view class="list-item-header" v-html="help.contents"></view>
					<view class="list-item-body" v-if="help.imgpath" @tap="viewPic(help.imgpath)">
						<image class="img" mode="aspectFit" :src="help.imgpath"></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getHelp } from '@/api/configure.js';
	import { deepClone, mergeUrls, getUserInfo, toLogin, previewImage } from '@/util/util.js';
	import configUrl from '@/util/url.js';

	export default {
		data() {
			return {
				helps: []
			}
		},
		methods: {
			async getHelp() {
				let parm={
					equipmentName:'',//设备名称
					type:''//文档类型
				};
				
				let {data, code} = await getHelp(parm);
				
				if(code == 0) {
					this.helps = data.slice(0)
				}
			},
			viewPic(url) {
				let urls = [url];
				
				previewImage({
					urls: urls
				})
			},
			init() {
				this.getHelp();
			}
		},
		onLoad() {
			this.init();
		},
		onReady() {}
	}
</script>

<style lang="scss">
	.help{
		padding: 30rpx 30rpx;
	}
	
	.list{
		font-size: 28rpx;
		.list-group{
			.list-item{
				margin-bottom: 30rpx;
			}
		}
	}
	
	.img{
		width: 100%;
		height: 1400rpx;
	}
</style>
